April 23, 2019

Sleep

The sleep dataset shows the effect of two soporific drugs (increase in hours of sleep compared to control) on 10 students.

extra group ID
0.7 1 1
-1.6 1 2
-0.2 1 3
-1.2 1 4
-0.1 1 5
3.4 1 6

Extra hours of sleep vs drug given

library(plotly)
plot_ly(sleep, y = ~extra, color = ~group, type = "box")

Slide with R Output

plot_ly(sleep, x= ~ID, y = ~extra, color = ~group, type = "scatter")

Thanks!!!